<?php

namespace State;

class Context
{
    /** @var StateInterface 存储状态实体类对象 */
    public StateInterface $state;

    public function __construct(StateInterface $object)
    {
        $this->state = $object;
    }

    /** 对请求做处理，并设置下一状态 */
    public function request()
    {
        return $this->state->Handle($this);
    }
}